package structural.proxy.dynamic;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class DynamicProxyHandler implements InvocationHandler {
    private Object m_pObj;

    public DynamicProxyHandler(Object pObj) {
        this.m_pObj = pObj;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("执行前");
        Object objResult = method.invoke(m_pObj, args);
        System.out.println("执行后");
        return objResult;
    }
}
